<?php $this->fetch('public/head') ?>
<div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title">
        <li class=""><a href="<?php echo url('index') ?>">信息管理</a></li>
        <li class="layui-this">工资导入</li>
    </ul>
    <div class="layui-tab-content">
        <!-- <div class="layui-input-inline">
            <input type="text" class="layui-input" id="dt" name="dt" placeholder="yyyyMM">
        </div> -->
        <div class="layui-inline">
            <button type="button" class="layui-btn file_upload" id="test3"><i class="layui-icon"></i>工资单导入</button>
        </div>
        <div class="layui-inline">
            <a class="layui-btn" href="<?php echo url('downloads');?>">模板下载</a>
        </div>
    </div>
</div>
<?php $this->fetch('public/script') ?>
<script>
    //处理ie10以下同一个页面有1个以上的单图片上传
    layui.use('upload', function(){
        var upload = layui.upload;
        upload.render({
            elem: '.file_upload',
            url: '<?php echo url('salary/upload') ?>',
            accept: 'file',   //默认images
            // exts: 'pdf',
            before: function(obj){ //obj参数包含的信息，跟 choose回调完全一致，可参见上文。
                layer.msg('上传中···',{time:60000,icon: 16,shade: 0.3});
            },
            done: function(res){
                layer.msg(res.msg);
                setTimeout(function () {
                    layer.closeAll();
                },1500)
				if (res.code == 1){
                    window.location.href="<?php echo url('salary/showList') ?>";
                }

            }
        });
    });
</script>